//引入request因为里面封装了axios
import request from '@/utils/request'

export default{
    //1.教师列表获取
    //三个参数：当前页、每页记录数、分页的query对象
    getTeacherListPage(current,limit,teacherQuery){
        return request({
            url: `/eduservice/teacher/pageTeacherCondition/${current}/${limit}`,
            method:'post',
            //teacherQuery条件对象，后端使用RequestBody Json数据格式时,parpam要换成data
            data: teacherQuery
        })
    },
    //2.教师删除
    deleteTeacherById(id){
        return request({
            url:`/eduservice/teacher/${id}`,
            method: 'delete'
        })
    },
    //3.添加教师
    addTeacher(teacher){
        return request({
            url:`/eduservice/teacher/addTeacher`,
            method:'post',
            data: teacher
        })
    },
    //4.根据id查询数据，用于数据回显
    getTeacherInfoById(id) {
        return request({
          url: `/eduservice/teacher/${id}`,
          method: 'get'
        })
      },
    //5.修改教师
    updateTeacher(teacher) {
        return request({
          url: '/eduservice/teacher/updateTeacher',
          method: 'put',
          data: teacher
        })
      },
     
}